Optimal. Leaf size=188 \[ \frac{\left (6 a^2 A b+2 a^3 B+9 a b^2 B+3 A b^3\right ) \tan (c+d x)}{3 d}+\frac{\left (3 a^3 A+12 a^2 b B+12 a A b^2+8 b^3 B\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{a \left (3 a^2 A+12 a b B+10 A b^2\right ) \tan (c+d x) \sec (c+d x)}{8 d}+\frac{a^2 (2 a B+3 A b) \tan (c+d x) \sec ^2(c+d x)}{6 d}+\frac{a A \tan (c+d x) \sec ^3(c+d x) (a+b \cos (c+d x))^2}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.457663, antiderivative size = 188, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.226, Rules used = {2989, 3031, 3021, 2748, 3767, 8, 3770} \[ \frac{\left (6 a^2 A b+2 a^3 B+9 a b^2 B+3 A b^3\right ) \tan (c+d x)}{3 d}+\frac{\left (3 a^3 A+12 a^2 b B+12 a A b^2+8 b^3 B\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{a \left (3 a^2 A+12 a b B+10 A b^2\right ) \tan (c+d x) \sec (c+d x)}{8 d}+\frac{a^2 (2 a B+3 A b) \tan (c+d x) \sec ^2(c+d x)}{6 d}+\frac{a A \tan (c+d x) \sec ^3(c+d x) (a+b \cos (c+d x))^2}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2989
Rule 3031
Rule 3021
Rule 2748
Rule 3767
Rule 8
Rule 3770
Rubi steps
\begin{align*} \int (a+b \cos (c+d x))^3 (A+B \cos (c+d x)) \sec ^5(c+d x) \, dx &=\frac{a A (a+b \cos (c+d x))^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac{1}{4} \int (a+b \cos (c+d x)) \left (2 a (3 A b+2 a B)+\left (3 a^2 A+4 A b^2+8 a b B\right ) \cos (c+d x)+b (a A+4 b B) \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx\\ &=\frac{a^2 (3 A b+2 a B) \sec ^2(c+d x) \tan (c+d x)}{6 d}+\frac{a A (a+b \cos (c+d x))^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac{1}{12} \int \left (-3 a \left (3 a^2 A+10 A b^2+12 a b B\right )-4 \left (6 a^2 A b+3 A b^3+2 a^3 B+9 a b^2 B\right ) \cos (c+d x)-3 b^2 (a A+4 b B) \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx\\ &=\frac{a \left (3 a^2 A+10 A b^2+12 a b B\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac{a^2 (3 A b+2 a B) \sec ^2(c+d x) \tan (c+d x)}{6 d}+\frac{a A (a+b \cos (c+d x))^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac{1}{24} \int \left (-8 \left (6 a^2 A b+3 A b^3+2 a^3 B+9 a b^2 B\right )-3 \left (3 a^3 A+12 a A b^2+12 a^2 b B+8 b^3 B\right ) \cos (c+d x)\right ) \sec ^2(c+d x) \, dx\\ &=\frac{a \left (3 a^2 A+10 A b^2+12 a b B\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac{a^2 (3 A b+2 a B) \sec ^2(c+d x) \tan (c+d x)}{6 d}+\frac{a A (a+b \cos (c+d x))^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac{1}{3} \left (-6 a^2 A b-3 A b^3-2 a^3 B-9 a b^2 B\right ) \int \sec ^2(c+d x) \, dx-\frac{1}{8} \left (-3 a^3 A-12 a A b^2-12 a^2 b B-8 b^3 B\right ) \int \sec (c+d x) \, dx\\ &=\frac{\left (3 a^3 A+12 a A b^2+12 a^2 b B+8 b^3 B\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{a \left (3 a^2 A+10 A b^2+12 a b B\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac{a^2 (3 A b+2 a B) \sec ^2(c+d x) \tan (c+d x)}{6 d}+\frac{a A (a+b \cos (c+d x))^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac{\left (6 a^2 A b+3 A b^3+2 a^3 B+9 a b^2 B\right ) \operatorname{Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d}\\ &=\frac{\left (3 a^3 A+12 a A b^2+12 a^2 b B+8 b^3 B\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac{\left (6 a^2 A b+3 A b^3+2 a^3 B+9 a b^2 B\right ) \tan (c+d x)}{3 d}+\frac{a \left (3 a^2 A+10 A b^2+12 a b B\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac{a^2 (3 A b+2 a B) \sec ^2(c+d x) \tan (c+d x)}{6 d}+\frac{a A (a+b \cos (c+d x))^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}\\ \end{align*}
Mathematica [A] time = 0.803062, size = 140, normalized size = 0.74 \[ \frac{3 \left (3 a^3 A+12 a^2 b B+12 a A b^2+8 b^3 B\right ) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (9 a \left (a^2 A+4 a b B+4 A b^2\right ) \sec (c+d x)+24 \left (3 a^2 A b+a^3 B+3 a b^2 B+A b^3\right )+8 a^2 (a B+3 A b) \tan ^2(c+d x)+6 a^3 A \sec ^3(c+d x)\right )}{24 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.098, size = 290, normalized size = 1.5 \begin{align*}{\frac{A{a}^{3}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{3}}{4\,d}}+{\frac{3\,A{a}^{3}\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{8\,d}}+{\frac{3\,A{a}^{3}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{8\,d}}+{\frac{2\,{a}^{3}B\tan \left ( dx+c \right ) }{3\,d}}+{\frac{{a}^{3}B\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{2}}{3\,d}}+2\,{\frac{A{a}^{2}b\tan \left ( dx+c \right ) }{d}}+{\frac{A{a}^{2}b\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{2}}{d}}+{\frac{3\,{a}^{2}bB\tan \left ( dx+c \right ) \sec \left ( dx+c \right ) }{2\,d}}+{\frac{3\,{a}^{2}bB\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{2\,d}}+{\frac{3\,Aa{b}^{2}\tan \left ( dx+c \right ) \sec \left ( dx+c \right ) }{2\,d}}+{\frac{3\,Aa{b}^{2}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{2\,d}}+3\,{\frac{Ba{b}^{2}\tan \left ( dx+c \right ) }{d}}+{\frac{A{b}^{3}\tan \left ( dx+c \right ) }{d}}+{\frac{B{b}^{3}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.14916, size = 369, normalized size = 1.96 \begin{align*} \frac{16 \,{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{3} + 48 \,{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a^{2} b - 3 \, A a^{3}{\left (\frac{2 \,{\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 36 \, B a^{2} b{\left (\frac{2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 36 \, A a b^{2}{\left (\frac{2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 24 \, B b^{3}{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 144 \, B a b^{2} \tan \left (d x + c\right ) + 48 \, A b^{3} \tan \left (d x + c\right )}{48 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.57739, size = 510, normalized size = 2.71 \begin{align*} \frac{3 \,{\left (3 \, A a^{3} + 12 \, B a^{2} b + 12 \, A a b^{2} + 8 \, B b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \,{\left (3 \, A a^{3} + 12 \, B a^{2} b + 12 \, A a b^{2} + 8 \, B b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \,{\left (6 \, A a^{3} + 8 \,{\left (2 \, B a^{3} + 6 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} \cos \left (d x + c\right )^{3} + 9 \,{\left (A a^{3} + 4 \, B a^{2} b + 4 \, A a b^{2}\right )} \cos \left (d x + c\right )^{2} + 8 \,{\left (B a^{3} + 3 \, A a^{2} b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.36687, size = 791, normalized size = 4.21 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]